import yaml

f = open('config2.yaml',encoding="utf-8")
data = yaml.load(f.read(),Loader=yaml.FullLoader)
print(data)
f.close()

with open('config2.yaml') as f:
    data = yaml.load(f, Loader=yaml.FullLoader)